package main.java.ssm.filter;//package ssm.filter;/*
//package ssm.filter;
//
//import ssm.pojo.Admin;
//
//import javax.servlet.*;
//import javax.servlet.http.HttpServletRequest;
//import java.io.IOException;
//
//*/
//
//import ssm.pojo.Admin;
//
//import javax.servlet.*;
//import javax.servlet.http.HttpServletRequest;
//import java.io.IOException;
//
///**
// * Created by Administrator on 2017/6/9.
// */
//
//public class LoginFilter implements Filter {
//    @Override
//    public void init(FilterConfig filterConfig) throws ServletException {
//
//    }
//
//    @Override
//    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
//        HttpServletRequest hsq = (HttpServletRequest) req;
//        Admin u = (Admin) hsq.getSession().getAttribute("loginAdmin");
//        System.out.println("开始登录验证"+u);
//        if (u == null) {
//            req.getRequestDispatcher("/login").forward(req,resp);
////            ((HttpServletResponse) resp).sendRedirect(hsq.getContextPath() + "/login");
////            ((HttpServletResponse) resp).
//        }else {
//            req.getRequestDispatcher("/user/user").forward(req,resp);
//        }
//        chain.doFilter(req, resp);
//    }
//
//    @Override
//    public void destroy() {
//
//    }
//}
//
